layui.define([ 'form', 'laydate', 'table','rechargeApi'], function(exports) {
	var form = layui.form;
	var rechargeApi = layui.rechargeApi;
	var index = layui.index;
	var view = {
			init:function(){
				Lib.initGenrealForm($("#updateForm"),form);
				this.initSubmit();
			},
			initSubmit:function(){
				$("#rechargeOrder").click(function(){
					
					var scoreValue = $("input[name='score']").val();

					if(scoreValue>0){
						rechargeApi.updateRecharge($('#updateForm'),function(){
							parent.window.dataReload();
							Common.info("充值成功");
							Lib.closeFrame();
						});
					} else {
						Common.info("充值额必须大于0，且不能为空！");
					}
					
					
				});
				
				$("#rechargeOrder-cancel").click(function(){
					Lib.closeFrame();
				});
			}
				
	}
	
	
	
	 exports('edit',view);
	
});